{eyou:volist name="$users_para" id="vo"}
    {eyou:switch name="vo.dtype"}
        {eyou:case value="hidden"}
        <!-- 隐藏域 start -->
        <div class="item-from-row" style="display: none;">
            <dt class="tit">{$vo.title}：</dt>
            <dd class="opt">
                <input type="hidden" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">
            </dd>
        </div>
        <!-- 隐藏域 end -->
        {/eyou:case}

        {eyou:case value="mobile"}
        <!-- 手机文本框 start -->
        <div class="item-from-row">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r">
                {$vo.dfvalue|default=''}
                {eyou:eq name='$users.is_mobile' value='1'}
                    <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_mobile_code('更改手机');">( 更改手机 )</a></span>
                {eyou:else/}
                    <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_mobile_code('绑定手机');">( 绑定手机 )</a></span>
                {/eyou:eq}
                <script type="text/javascript">
                    function get_{$vo.fieldArr}{$vo.name|default=''}_mobile_code(title) {
                        var url = '{$RootDir}/index.php?m=user&c=Users&a=bind_mobile';
                        if (url.indexOf('?') > -1) {
                            url += '&';
                        } else {
                            url += '?';
                        }
                        url += 'title=' + title;
                        //iframe窗
                        layer.open({
                            type: 2,
                            title: title,
                            shadeClose: false,
                            maxmin: false, //开启最大化最小化按钮
                            area: ['400px', '330px'],
                            content: url
                        });
                    }
                </script> 
                <p class="notic">{$vo.remark|default=''}</p>
            </div>
        </div>
        <!-- 手机文本框 end -->
        {/eyou:case}

        {eyou:case value="email"}
        <!-- 邮箱文本框 start -->
        <div class="item-from-row">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r">
                {$vo.dfvalue|default=''}
                {eyou:eq name='$users.is_email' value='1'}
                    <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_email_code('更改邮箱');">( 更改邮箱 )</a></span>
                {eyou:else/}
                    <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_email_code('绑定邮箱');">( 绑定邮箱 )</a></span>
                {/eyou:eq}
                <p class="notic">{$vo.remark|default=''}</p>
            </div>
        </div>
        <script type="text/javascript">
            function get_{$vo.fieldArr}{$vo.name|default=''}_email_code(title)
            {
                var url = "{eyou:url link='user/Users/bind_email'/}";
                if (url.indexOf('?') > -1) {
                    url += '&';
                } else {
                    url += '?';
                }
                url += 'title='+title;
                //iframe窗
                layer.open({
                    type: 2,
                    title: title,
                    shadeClose: false,
                    maxmin: false, //开启最大化最小化按钮
                    area: ['400px', '270px'],
                    content: url
                });
            }
        </script>
        <!-- 邮箱文本框 end -->
        {/eyou:case}

        {eyou:case value="text"}
        <!-- 单行文本框 start -->
        <div class="item-from-row">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r">
                <input type="text" class="el-input__inner w310" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" autocomplete="off">{$vo.dfvalue_unit|default=''}
            </div>
        </div>
        <!-- 单行文本框 end -->
        {/eyou:case}

        {eyou:case value="multitext"}
        <!-- 多行文本框 start -->
        <div class="item-from-row">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r">
                <textarea id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" class="w310" autocomplete="off">{$vo.dfvalue|default=''}</textarea>
            </div>
        </div>
        <!-- 多行文本框 end -->
        {/eyou:case}

        {eyou:case value="checkbox"}
        <!-- 复选框 start -->
        <div class="item-from-row">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r">
                {eyou:volist name="$vo.dfvalue" id="v2"}
                <label class="checkbox-label">
                    <span>{$v2}</span>
                    <input type="checkbox" class="checkbox" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"} checked="checked" {/if}>
                    <span class="check-mark"></span>
                </label>
                {/eyou:volist}
                <!-- {eyou:if condition="1 == $vo.is_required"}（必选）{/eyou:if} -->
            </div>
        </div>
        <!-- 复选框 end -->
        {/eyou:case}

        {eyou:case value="radio"}
        <!-- 单选项 start -->
        <div class="item-from-row">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r">
                {eyou:volist name="$vo.dfvalue" id="v2"}
                <label class="radio-label">
                    <span>{$v2}</span>
                    <input type="radio" class="radio" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$v2}" {eyou:if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"} checked="checked" {/eyou:if}>
                    <span class="check-mark"></span>
                </label>
                {/eyou:volist}
                <!-- {eyou:if condition="1 == $vo.is_required"}（必选）{/eyou:if} -->
            </div>
        </div>
        <!-- 单选项 end -->
        {/eyou:case}

        {eyou:case value="select"}
        <!-- 下拉框 start -->
        <div class="item-from-row">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r">
                <div class="w310 select">
                    <select name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}">
                        <option value="">请选择</option>
                        {eyou:volist name="$vo.dfvalue" id="v2"}
                        <option value="{$v2}" {eyou:if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"} selected {/eyou:if}>{$v2}</option>
                        {/eyou:volist}
                    </select>
                </div>
            </div>
        </div>
        <!-- 下拉框 end -->
        {/eyou:case}

        {eyou:case value="img"}
        <!-- 单张图 start -->
        <div class="item-from-row">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r">
                <a href="javascript:void(0);" onclick="$('#singlePicFile_{$vo.fieldArr}_{$vo.name|default=''}').trigger('click');" class="img-upload">
                    <div class="y-line" id="singlePicYline_{$vo.para_id|default=0}" {notempty name='$vo.info'} style="display: none;" {/notempty}></div>
                    <div class="x-line" id="singlePicXline_{$vo.para_id|default=0}" {notempty name='$vo.info'} style="display: none;" {/notempty}></div>
                    <img src="{$vo.info|default=''}" id="singlePicImgSrc_{$vo.para_id|default=0}" >
                </a>
            </div>
            <input type="file" id="singlePicFile_{$vo.fieldArr}_{$vo.name|default=''}" data-id="{$vo.para_id|default=0}" onchange="uploadSinglePicFile(this);" style="display: none;">
            <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="singlePicHidden_{$vo.para_id|default=0}" value="{$vo.info|default=''}">
        </div>
        <!-- 单张图 end -->
        {/eyou:case}

        {case value="imgs"}
        <script type="text/javascript" src="__STATIC__/admin/js/jquery-ui/jquery-ui.min.js"></script>
        <!-- 多张图 start -->
        <div class="item-from-row" id="dl_{$vo.fieldArr}_{$vo.name|default=''}">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r">
                <div class="images_upload_main" id="tab_{$vo.fieldArr}_{$vo.name|default=''}">
                    <div class="sort-list-{$vo.fieldArr}_{$vo.name|default=''}">
                        {volist name="$vo[$vo['name'].'_eyou_imgupload_list']" id="v2" key="k2"}
                        <div class="fieldext_upload fieldext_upload_html" >
                            <div class="images_upload_item">
                                <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2|default=''}">
                                <a href="{$v2|default=''}" onclick="" target="_blank" class="pic">
                                    <img src="{$v2|default=''}">
                                </a>
                                <a class="delete" title="删除" href="javascript:void(0)" onclick="{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'{$v2|default=''}')"></a>
                            </div>
                        </div>
                        {/volist}
                        <div class="fieldext_upload" style="display:none;"></div>
                    </div>
                    <a href="javascript:void(0);" onClick="GetUploadify(100,'','allimg','{$vo.fieldArr}_{$vo.name|default=''}_call_back', '', '{$vo.title}');" class="img-upload" title="上传图片">
                        <div class="y-line"></div>
                        <div class="x-line"></div>
                    </a>
                </div>
                <!-- 上传图片显示的样板 start -->
                <div class="{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl" style="display: none;">
                    <div class="fieldext_upload fieldext_upload_html">
                        <div class="images_upload_item">
                            <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="" />
                            <a href="javascript:void(0);" onClick="" >
                                <img src="__STATIC__/admin/images/add-button.jpg"/>
                            </a>
                            <a class="delete" href="javascript:void(0)" title="删除">&nbsp;&nbsp;</a>
                        </div>
                    </div>
                </div>
                <!-- 上传图片显示的样板 end -->
            </div>
        </div>
        <script type="text/javascript">
            // 上传多图回调函数
            function {$vo.fieldArr}_{$vo.name|default=''}_call_back(paths) {
                var  last_div = $(".{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl").html();
                for (var i = 0; i < paths.length; i++) {
                    if ($(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html").length > 0) {
                        $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").after(last_div);  // 插入一个 新图片
                    } else {
                        $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload:last").before(last_div);  // 插入一个 新图片
                    }
                    $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
                    $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('img').attr('src',paths[i]);// 修改他的图片路径
                    $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('a:eq(1)').attr('onclick',"{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'"+paths[i]+"')").text('');
                    $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('input').val(paths[i]); // 设置隐藏域 要提交的值
                }
            }

            // 上传之后删除组图input
            function {$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(obj,path) {
                $(obj).parent().remove();
            }

            /** 以下 产品相册的拖动排序相关 js*/
            $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).sortable({
                start: function( event, ui) {},
                stop: function( event, ui ) {}
            });
            $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).disableSelection();
        </script>
        <!-- 多张图 end -->
        {/case}
        
        {case value="file"}
        {eyou:static file="/public/plugins/layui/css/layui.css" /}
        {eyou:static file="/public/plugins/layui/layui.js" /}
        <!-- 单个文件 start -->
        <div class="item-from-row">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r" >
                <a id="download_file_{$vo.fieldArr}_{$vo.name|default=''}" style="margin-right: 30px;text-decoration: underline;{eyou:notempty name='$vo.info' /}display: '';{eyou:else /}display: none;{/eyou:notempty}"
                   {eyou:notempty name='$vo.info' /} href="{$vo.info|default=''}" download="{$vo.info|get_filename=###}" {/eyou:notempty}>
                <img src="__STATIC__/common/images/file.png" alt="" style="width: 16px;height:  16px;">下载附件</a>
                <input type="text" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.info|default=''}" style="display: none;">
                <button type="button" class="el-button el-button--primary is-plain el-button--small" id="upload_{$vo.fieldArr}_{$vo.name|default=''}" style="height: 40px;">上传文件</button>
            </div>
        </div>
        <script type="text/javascript">
            $(function(){
                layui.use('upload', function(){
                    // 执行实例
                    var upload = layui.upload;
                    var uploadInst = upload.render({
                        elem: "#upload_{$vo.fieldArr}_{$vo.name|default=''}",
                        url: "{:url('user/Uploadify/DownloadUploadFileAjax')}",
                        accept: 'file',
                        exts: '{$vo.ext}',
                        size: {$vo.filesize},
                        done: function(res) {
                            if (res.state == "SUCCESS") {
                                layer.msg('上传成功!')
                                $("#{$vo.fieldArr}_{$vo.name|default=''}").val(res.url);
                                $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('display','');
                                $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").attr('href',res.url);
                                var arr = res.url.split("/");
                                var download = arr[arr.length-1];
                                $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").attr('download',download);
                                $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('color','#000');
                                $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").html('<img src="__STATIC__/common/images/file.png" alt="" style="width: 16px;height:  16px;">下载附件');
                            } else {
                                showErrorAlert(res.state);
                                $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('display','');
                                $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('color','red');
                                $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").text(res.state);
                            }
                        }
                    });
                });
            })
        </script>
        <!-- 单个文件 end -->
        {/case}

        {eyou:case value="datetime"}
        <!-- 日期和时间 start -->
        {eyou:static file="/public/plugins/laydate/laydate.js"/}
        <div class="item-from-row">
            <div class="from-row-l">
                {eyou:if condition="1 == $vo.is_required"}
                    <span class="red">*</span>
                {eyou:else/}
                    <span class="red"></span>
                {/eyou:if}
                {$vo.title}：
            </div>
            <div class="from-row-r">
                <input type="text" class="el-input__inner w310" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" autocomplete="off">{$vo.dfvalue_unit|default=''}
            </div>
        </div>
        <script type="text/javascript">
            $(function () {
                $('#{$vo.fieldArr}_{$vo.name|default=''}').layDate();
            });
        </script>
        <!-- 日期和时间 end -->
        {/eyou:case}
    {/eyou:switch}
{/eyou:volist}

<script type="text/javascript">
    // 单图上传
    function uploadSinglePicFile(obj) {
        var file = $(obj)[0].files[0];
        if (!file) return false;
        var formData = new FormData();
        formData.append('_ajax', 1);
        formData.append('file', file);
        formData.append('compress', '1000-1000');
        layer_loading('正在处理');
        $.ajax({
            type: 'post',
            url : eyou_basefile + "?m=user&c=Uploadify&a=imageUp",
            data: formData,
            contentType: false,
            processData: false,
            dataType: 'json',
            success: function (res) {
                layer.closeAll();
                if (res.state == 'SUCCESS') {
                    var id = $(obj).data('id');
                    $("#singlePicHidden_" + id).val(res.url);
                    $("#singlePicImgSrc_" + id).show().attr('src', res.url);
                    $('#singlePicYline_'+id+', #singlePicXline_' + id).hide();
                } else {
                    showErrorAlert(res.state);
                }
            },
            error: function(e) {
                layer.closeAll();
                showErrorAlert(e.responseText);
            }
        })
    }
</script>